import java.util.HashSet;
import java.util.Scanner;
//  删除 str1 中 str2 子串成分。
public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNextLine()){
            String str1= sc.nextLine();
            String str2 = sc.nextLine();
            HashSet<Character> set = new HashSet<>();
            for(int i = 0;i < str2.length();i++){
                char ch = str2.charAt(i);
                if(ch == ' '){
                    continue;
                }
                set.add(ch);
            }
            StringBuilder sb = new StringBuilder();
            func(sb,set,str1);
        }
    }
    public static String func(StringBuilder sb,HashSet<Character> set,String str1){
        for(int i = 0;i < str1.length();i++){
            char ch = str1.charAt(i);
            if(!set.contains(ch)){
                sb.append(ch);
            }
        }
        return sb.toString();
    }
}
